package com.HMI;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.List;

import javax.swing.JPanel;

import com.Resources.CustomColor;

@SuppressWarnings("serial")
public class Draw extends JPanel {

	List<Integer> yCoord;
	
	public void drawing(List<Integer> yCoord) {
		this.yCoord = yCoord;
		this.setBackground(CustomColor.WHITE);
		this.setOpaque(true);
		repaint();
	}
	
	@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		Graphics2D g2 = (Graphics2D) g;
		g2.setStroke(new BasicStroke(3));
		g2.setColor(Color.BLUE);
		for(int i=0; i<yCoord.size()-1; i++) {
		     g2.drawLine(i,-(yCoord.get(i)-100),i+1,-(yCoord.get(i+1)-100));
		}
	}
}
